package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:55
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemModule implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id", com.ourteam.system.dao.ISysModuleDAO.Id);

        mappedDaoFields.put("moduleCode",
            com.ourteam.system.dao.ISysModuleDAO.ModuleCode);

        mappedDaoFields.put("moduleName",
            com.ourteam.system.dao.ISysModuleDAO.ModuleName);

        mappedDaoFields.put("parentModuleId",
            com.ourteam.system.dao.ISysModuleDAO.ParentModuleId);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysModuleDAO.Remarks);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysModuleDAO.Status);

        mappedDaoFields.put("domainId",
            com.ourteam.system.dao.ISysModuleDAO.DomainId);

        mappedDaoFields.put("moduleIcon",
            com.ourteam.system.dao.ISysModuleDAO.ModuleIcon);

        mappedDaoFields.put("sortIndex",
            com.ourteam.system.dao.ISysModuleDAO.SortIndex);

        mappedDaoFields.put("domainCode",
            com.ourteam.system.dao.ISysModuleDAO.DomainCode);

        mappedDaoFields.put("domainName",
            com.ourteam.system.dao.ISysModuleDAO.DomainName);

        mappedDaoFields.put("moduleIconContent",
            com.ourteam.system.dao.ISysModuleDAO.ModuleIconContent);

        mappedDaoFields.put("moduleType",
            com.ourteam.system.dao.ISysModuleDAO.ModuleType);
    }

    private com.ourteam.system.dao.SysModule sysModule;

    public SystemModule() {
        super();

        this.sysModule = new com.ourteam.system.dao.SysModule();
    }

    public SystemModule(com.ourteam.system.dao.SysModule sysModule) {
        super();

        this.sysModule = sysModule;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysModule);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysModule convertToSysModule() {
        return this.sysModule;
    }

    public com.ourteam.system.dao.SysModule convertTo() {
        return this.sysModule;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysModule.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysModule.setId(id);
    }

    /**
     * Get moduleCode
     *
     * @return String
     */
    public String getModuleCode() {
        return (String) this.sysModule.getModuleCode();
    }

    /**
     * Set moduleCode
     *
     * @parameter String
     */
    public void setModuleCode(String moduleCode) {
        this.sysModule.setModuleCode(moduleCode);
    }

    /**
     * Get moduleName
     *
     * @return String
     */
    public String getModuleName() {
        return (String) this.sysModule.getModuleName();
    }

    /**
     * Set moduleName
     *
     * @parameter String
     */
    public void setModuleName(String moduleName) {
        this.sysModule.setModuleName(moduleName);
    }

    /**
     * Get parentModuleId
     *
     * @return long
     */
    public long getParentModuleId() {
        return (long) this.sysModule.getParentModuleId();
    }

    /**
     * Set parentModuleId
     *
     * @parameter long
     */
    public void setParentModuleId(long parentModuleId) {
        this.sysModule.setParentModuleId(parentModuleId);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysModule.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysModule.setRemarks(remarks);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysModule.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysModule.setStatus(status);
    }

    /**
     * Get domainId
     *
     * @return long
     */
    public long getDomainId() {
        return (long) this.sysModule.getDomainId();
    }

    /**
     * Set domainId
     *
     * @parameter long
     */
    public void setDomainId(long domainId) {
        this.sysModule.setDomainId(domainId);
    }

    /**
     * Get moduleIcon
     *
     * @return String
     */
    public String getModuleIcon() {
        return (String) this.sysModule.getModuleIcon();
    }

    /**
     * Set moduleIcon
     *
     * @parameter String
     */
    public void setModuleIcon(String moduleIcon) {
        this.sysModule.setModuleIcon(moduleIcon);
    }

    /**
     * Get sortIndex
     *
     * @return int
     */
    public int getSortIndex() {
        return (int) this.sysModule.getSortIndex();
    }

    /**
     * Set sortIndex
     *
     * @parameter int
     */
    public void setSortIndex(int sortIndex) {
        this.sysModule.setSortIndex(sortIndex);
    }

    /**
     * Get domainCode
     *
     * @return String
     */
    public String getDomainCode() {
        return (String) this.sysModule.getDomainCode();
    }

    /**
     * Get domainName
     *
     * @return String
     */
    public String getDomainName() {
        return (String) this.sysModule.getDomainName();
    }

    /**
     * Get moduleIconContent
     *
     * @return byte
     */
    public byte[] getModuleIconContent() {
        return (byte[]) this.sysModule.getModuleIconContent();
    }

    /**
     * Set moduleIconContent
     *
     * @parameter byte
     */
    public void setModuleIconContent(byte[] moduleIconContent) {
        this.sysModule.setModuleIconContent(moduleIconContent);
    }

    /**
     * Get moduleType
     *
     * @return String
     */
    public String getModuleType() {
        return (String) this.sysModule.getModuleType();
    }

    /**
     * Set moduleType
     *
     * @parameter String
     */
    public void setModuleType(String moduleType) {
        this.sysModule.setModuleType(moduleType);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemModule) == false) {
            return false;
        } // end if

        SystemModule other = (SystemModule) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysModule tempSysModule = other.convertToSysModule();

        if ((tempSysModule == null) || (this.sysModule == null)) {
            isEqual = false;
        } else if ((tempSysModule == this.sysModule) ||
                tempSysModule.equals(this.sysModule)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemModule[] toArray(
        com.ourteam.system.dao.SysModule[] aSysModules) {
        return toArray(aSysModules, null);
    }

    public static SystemModule[] toArray(
        com.ourteam.system.dao.SysModule[] aSysModules,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysModules)) {
            return new SystemModule[0];
        }

        int length = aSysModules.length;

        SystemModule[] beans = new SystemModule[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemModule(aSysModules[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i], new Object[] { aSysModules[i] });
            }
        }

        return beans;
    }
}
